#include"stdio.h"
#include"math.h"
int  main()
{
   long long int a[100010]={0},n,b[100010]={0},i,j,x=0,y=0;
    scanf("%lld",&n);
    for(i=1;i<=n;i++)
        scanf("%lld",&a[i]);
        b[1]=a[1];
    for(i=2;i<=n;i++)
        b[i]=a[i]-a[i-1];
       for(i=1;i<=n;i++)
       {
           if(b[i]>0)
            x+=b[i];
           else y+=abs(b[i]);
       }
    printf("%lld\n",x>y?x:y);
    printf("%lld",abs(x-y)+1);
    return 0;
}
